set(LLVM_IR_DIR ${LLVM_MAIN_SRC_DIR}/lib/IR)

add_llvm_component_library(LLVMBuddyCore
  ${LLVM_IR_DIR}/AbstractCallSite.cpp
  ${LLVM_IR_DIR}/AsmWriter.cpp
  ${LLVM_IR_DIR}/Assumptions.cpp
  ${LLVM_IR_DIR}/Attributes.cpp
  ${LLVM_IR_DIR}/AutoUpgrade.cpp
  ${LLVM_IR_DIR}/BasicBlock.cpp
  ${LLVM_IR_DIR}/BuiltinGCs.cpp
  ${LLVM_IR_DIR}/Comdat.cpp
  ${LLVM_IR_DIR}/ConstantFold.cpp
  ${LLVM_IR_DIR}/ConstantRange.cpp
  ${LLVM_IR_DIR}/Constants.cpp
  ${LLVM_IR_DIR}/Core.cpp
  ${LLVM_IR_DIR}/DIBuilder.cpp
  ${LLVM_IR_DIR}/DataLayout.cpp
  ${LLVM_IR_DIR}/DebugInfo.cpp
  ${LLVM_IR_DIR}/DebugInfoMetadata.cpp
  ${LLVM_IR_DIR}/DebugLoc.cpp
  ${LLVM_IR_DIR}/DiagnosticHandler.cpp
  ${LLVM_IR_DIR}/DiagnosticInfo.cpp
  ${LLVM_IR_DIR}/DiagnosticPrinter.cpp
  ${LLVM_IR_DIR}/Dominators.cpp
  ${LLVM_IR_DIR}/EHPersonalities.cpp
  ${LLVM_IR_DIR}/FPEnv.cpp
  ${LLVM_IR_DIR}/Function.cpp
  ${LLVM_IR_DIR}/GCStrategy.cpp
  ${LLVM_IR_DIR}/GVMaterializer.cpp
  ${LLVM_IR_DIR}/Globals.cpp
  ${LLVM_IR_DIR}/IRBuilder.cpp
  ${LLVM_IR_DIR}/IRPrintingPasses.cpp
  ${LLVM_IR_DIR}/SSAContext.cpp
  ${LLVM_IR_DIR}/InlineAsm.cpp
  ${LLVM_IR_DIR}/Instruction.cpp
  ${LLVM_IR_DIR}/Instructions.cpp
  ${LLVM_IR_DIR}/IntrinsicInst.cpp
  ${LLVM_IR_DIR}/LLVMContext.cpp
  ${LLVM_IR_DIR}/LLVMContextImpl.cpp
  ${LLVM_IR_DIR}/LLVMRemarkStreamer.cpp
  ${LLVM_IR_DIR}/LegacyPassManager.cpp
  ${LLVM_IR_DIR}/MDBuilder.cpp
  ${LLVM_IR_DIR}/Mangler.cpp
  ${LLVM_IR_DIR}/Metadata.cpp
  ${LLVM_IR_DIR}/Module.cpp
  ${LLVM_IR_DIR}/ModuleSummaryIndex.cpp
  ${LLVM_IR_DIR}/Operator.cpp
  ${LLVM_IR_DIR}/OptBisect.cpp
  ${LLVM_IR_DIR}/Pass.cpp
  ${LLVM_IR_DIR}/PassInstrumentation.cpp
  ${LLVM_IR_DIR}/PassManager.cpp
  ${LLVM_IR_DIR}/PassRegistry.cpp
  ${LLVM_IR_DIR}/PassTimingInfo.cpp
  ${LLVM_IR_DIR}/PrintPasses.cpp
  ${LLVM_IR_DIR}/ProfDataUtils.cpp
  ${LLVM_IR_DIR}/SafepointIRVerifier.cpp
  ${LLVM_IR_DIR}/ProfileSummary.cpp
  ${LLVM_IR_DIR}/PseudoProbe.cpp
  ${LLVM_IR_DIR}/ReplaceConstant.cpp
  ${LLVM_IR_DIR}/Statepoint.cpp
  ${LLVM_IR_DIR}/StructuralHash.cpp
  ${LLVM_IR_DIR}/Type.cpp
  ${LLVM_IR_DIR}/TypedPointerType.cpp
  ${LLVM_IR_DIR}/TypeFinder.cpp
  ${LLVM_IR_DIR}/Use.cpp
  ${LLVM_IR_DIR}/User.cpp
  ${LLVM_IR_DIR}/Value.cpp
  ${LLVM_IR_DIR}/ValueSymbolTable.cpp
  ${LLVM_IR_DIR}/VectorBuilder.cpp
  ${LLVM_IR_DIR}/Verifier.cpp

  ADDITIONAL_HEADER_DIRS
  ${LLVM_MAIN_INCLUDE_DIR}/llvm/IR

  LINK_LIBS
  ${LLVM_PTHREAD_LIB}

  DEPENDS
  buddy_intrinsics_gen

  LINK_COMPONENTS
  BinaryFormat
  Demangle
  BuddyRemarks
  Support
  TargetParser
  )
